home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 031a / owlbwcc.zip / BDEFRANG.CPP < prev    next >
C/C++ Source or Header  |  1992-01-26  |  3KB  |  73 lines

  1. /**********************************************************************/
  2. /*                  BDEFRANG.cpp by Bob Bourbonnais                   */
  3. /*              released to the public domain 1/26/92                 */
  4. /*           This program shows how to trap for ranges of             */
  5. /*             Button messages in the DefChild Process.               */
  6. /**********************************************************************/
  7. #include <owl.h>
  8. #include <dialog.h>
  9. #include "bwcc.h"                        // needed for BWCC
  10.  
  11. class TMyDialog : public TDialog
  12.   {
  13.   public:
  14.     TMyDialog(LPSTR lpDialogName)          // constructor calls
  15.       : TDialog(NULL,lpDialogName)         // base class constructor
  16.       {
  17.       BWCCGetVersion();    // activate Borland Windows Custom Controls
  18.       }
  19.     virtual void DefChildProc(RTMessage Msg);
  20.   };
  21.  
  22. void TMyDialog::DefChildProc(RTMessage Msg)
  23.   {
  24.   if (Msg.WParam <= 4)             // First row unprocessed messages 3 - 4
  25.     {
  26.     MessageBeep(0);
  27.     BWCCMessageBox(HWindow,"Feature Not Implemented","First Row",MB_OK);
  28.     }
  29.   else if (Msg.WParam <= 8)       // Second row unprocessed messages 5 - 8
  30.     {
  31.     MessageBeep(0);
  32.     BWCCMessageBox(HWindow,"Feature Not Implemented","Second Row",MB_OK);
  33.     MessageBeep(0);
  34.     }
  35.   else                            // Any other unprocessed child messages
  36.     {
  37.     MessageBeep(0);
  38.     BWCCMessageBox(HWindow,"Feature Not Implemented","Out of Range",MB_OK);
  39.     }
  40.  
  41.   TDialog::DefChildProc(Msg);
  42.   }
  43.  
  44. class TDialog1App : public TApplication  // Application Class to contain
  45.   {                                      // the application
  46.   public:
  47.     TDialog1App(LPSTR lpName, HANDLE hInstance,  // constructor calls the
  48.         HANDLE hPrevInstance,            // base class constructor
  49.         LPSTR lpCmdLine, int nCmdShow)
  50.         :TApplication(lpName, hInstance,
  51.                   hPrevInstance,
  52.                   lpCmdLine, nCmdShow) {};
  53.  
  54.     virtual void InitMainWindow(); // overrides base class InitMainWindow
  55.   };
  56.  
  57. void TDialog1App::InitMainWindow() // to initialize a dialog box
  58.   {                                // as the main window
  59.   MainWindow = new TMyDialog("MAINWINDOWDIALOG");
  60.   }
  61.  
  62. int PASCAL WinMain(HANDLE hInstance,              // main entry point from
  63.            HANDLE hPrevInstance,          // windows to this program
  64.            LPSTR lpCmdLine , int nCmdShow)
  65.   {
  66.   TDialog1App Dialog1("Dialog Tester",hInstance,  // create instance of
  67.                hPrevInstance,             // the dialog application
  68.                lpCmdLine,nCmdShow);
  69.   Dialog1.Run();                                  // run it
  70.   return (Dialog1.Status);                        // exit
  71.   }
  72. /**********************************************************************/
  73.